home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_aet_lightning.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
3KB
|
136 lines
# Jones 3D Cog Script
#
# aet_Lightning.cog
#
# [TL] [RD]
#
# (C) 1999 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message timer
message startup
message entered
message exited
message crossed
thing origin0 # Lightning targets.
thing target0
thing lightThing # Dynamic lightthing.
thing player local
surface startAdjoin
surface stopAdjoin
material lightningmat0=aet_4sfx_lightning_v2_a.mat local # Mats for the lightning.
material lightningmat1=aet_4sfx_lightning_v2_b.mat local
material lightningmat2=aet_4sfx_lightning_v2_c.mat local
material lightningmat3=aet_4sfx_lightning_v2_d.mat local
material lightningmat4=aet_4sfx_lightning_v2_e.mat local
sector damagesec # Lightning strike sectors.
sound strike0=aet_lightning_01.wav local
sound strike1=aet_lightning_02.wav local
sound strike2=aet_lightning_03.wav local
sound strike3=aet_lightning_04.wav local
int toggle local
int cnt local
int randnum local
int soundcheck=0
int strikechannel local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
SetThingFlags(lightThing, 0x80000);
return;
# ........................................................................................
crossed:
if (GetSourceRef() != player)
{
return;
}
if (GetSenderRef() == startAdjoin)
{
SetTimer(1.0);
}
else if (GetSenderRef() == stopAdjoin)
{
SetTimer(0.0);
}
return;
# ........................................................................................
entered:
# Damage indy if he enters the certain sector.
if (GetSenderRef() == damagesec)
{
toggle = 1;
}
return;
# ........................................................................................
exited:
# Stop damaging Indy when he leaves sector.
if (GetSenderRef() == damagesec)
{
toggle = 0;
}
return;
# ........................................................................................
timer:
# Lightning code.
ClearThingFlags(lightThing, 0x80000);
if (toggle == 0)
{
for (cnt = 2; cnt <= RandBetween(2, 5); cnt = cnt + 1)
{
CreatePolylineThing(origin0, target0, '0 0 0', lightningmat0[RandBetween(0, 4)], 0.1, 0.1, 0.05);
randnum = RandBetween(0, 3);
if (soundcheck == 1)
{
strikechannel = PlaySoundThing(strike0[randnum], target0, 0.35, 2.5, 10.0, 0);
}
Sleep(0.05);
}
}
if (toggle == 1)
{
CreatePolylineThing(origin0, player, '0 0 0', lightningmat0[RandBetween(0, 4)], 0.1, 0.1, 0.05);
randnum = RandBetween(0, 3);
if (soundcheck == 1)
{
strikechannel = PlaySoundThing(strike0[randnum], target0, 0.35, 2.5, 10.0, 0);
}
DamageThing(player, 100, 0x1, damagesec);
}
SetTimer(Rand() * 1.5);
SetThingFlags(lightThing, 0x80000);
//StopSound(strikechannel, 0);
return;
# ........................................................................................
end